package com.album.task;

import android.content.Context;
import android.os.Handler;
import android.util.Log;

import com.album.http.HttpRequest;
import com.album.utils.Config;

/**
 * 图片分类属性列表
 * @author Rome
 *
 */
public class GetPicinfolistTask  extends Task{
	private String TAG = "HttpRspThread";
	private Context ctx;
	private ICallBack callBack;
	private String username;
	private int type;
	private int attribute;
	private String pageSize;
	
	public GetPicinfolistTask(Context ctx,String username,int type,int attribute,String pageSize,ICallBack resTask){
		this.ctx = ctx;
		this.callBack = resTask;
		this.username = username;
		this.type = type;
		this.attribute = attribute;
		this.pageSize = pageSize;
	}
	public String setRequest(){
		String strUrl =Config.TyHttp + Config.TyPicHttp+
		"picinfolist?type="+type
		+"&passport="+username
		+"&attribute="+attribute;
		//http://59.36.102.177:55520/interface/picmanage.jsp/picinfolist?type=4&passport=18926128667@189.cn&attribute=0
		String jsonString = HttpRequest.sendDataPost(ctx,strUrl, null,callBack);
		return jsonString;
	}
	@Override
	public void doTask(Task thread){
		Thread t = new Thread(thread);
		t.start();
	}
	@Override
	public void run() {
		//返回数据
		try {
			String strRsp = setRequest();
			callBack.CallBack(strRsp);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}


